package com.mxl.dao.cashorder.impl;

import java.util.List;

import org.hibernate.criterion.Restrictions;

import com.mxl.dao.cashorder.model.GatewayReturnLog;
import com.mxl.datebase.orm.hibernate.BaseDaoSupport;
import com.mxl.datebase.orm.pagination.Page;

public class GatewayReturnLogDaoImpl extends
		BaseDaoSupport<GatewayReturnLog, Long> {

	/**
	 * 查询状态是0的订单 通知商户 并且返回不是Y的数据 后续要做商户通知暂停和恢复功能
	 * 
	 * @return
	 */
	public List<GatewayReturnLog> queryNotifyMemberFailOrder() {
		Page p = new Page();
		p.setPageSize(10);
		return this
				.find(p,
						Restrictions.eq("status", 0),
						Restrictions.ne("responseContent", "Y"),
						Restrictions
								.sqlRestriction("creationDate>=DATE_SUB(now(), INTERVAL 1 DAY)"));
	}
}
